{% extends "bootstrap/base.html" %}

{% block title %}FastApp{% endblock %}

{% block head %}
{{ super() }}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
<link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css') }}">
{% endblock %}

{% block navbar %}
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{{ url_for('index') }}">FastApp</a>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                {% if current_user.is_authenticated %}
                <li><a href="{{ url_for('index', username=current_user.username) }}">个人资料</a></li>
                {% endif %}
            </ul>
            <ul class="nav navbar-nav navbar-right">

                {% if current_user.is_authenticated %}
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        
                        {{ current_user.username }} <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a href="{{ url_for('index') }}">修改资料</a></li>
                        <li><a href="{{ url_for('index') }}">修改密码</a></li>
                        <li><a href="{{ url_for('index') }}">修改头像</a></li>
                        <li><a href="{{ url_for('logout') }}">退出</a></li>
                    </ul>
                </li>
                {% else %}
                <li><a href="{{ url_for('register') }}">注册</a></li>
                <li><a href="{{ url_for('login') }}">登录</a></li>
                {% endif %}
            </ul>
        </div>
    </div>
</div>
{% endblock %}

{% block content %}
{% block header %}
<p> </p>
<p> 占位符 </p>
{% endblock %}

<div class="container">
    {% for message in get_flashed_messages() %}
    <div class="alert alert-warning">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        {{ message }}
    </div>
    {% endfor %}

    {% block page_content %}{% endblock %}
</div>

<div class="footer">
    <div class="container">
        <div style="float: left">Copyright © 2016 YDDL</div>
        <div style="float: right">
            <a href="https://git.oschina.net/loveswing/FastApp/tree/master/">FastApp</a>
            •
            <a href="https://github.com/David-Guo">YDDL</a>
        </div>
    </div>
</div>
{% endblock %}

{% block scripts %}
{{ super() }}
{{ moment.include_moment() }}
{% endblock %}
